class BG3UIElement extends Object
	abstract;

struct ElementColor
{
	var byte R;
	var byte G;
	var byte B;
	var byte A;

	structdefaultproperties
	{
		R = 255
		G = 255
		B = 255
		A = 255
	}
};

enum ScreenAnchor
{
	TOPLEFT,
	TOPRIGHT,
	BOTTOMLEFT,
	BOTTOMRIGHT
};

//screen position information
var int ScreenPosX;
var int ScreenPosY;

//offset position from anchorpoint
var int OffsetX;
var int OffsetY;

//width and length of the element in pixels
var int SizeX;
var int SizeY;

//color of this element
var ElementColor DrawColor;

//which corner of the screen do we anchor this element to
var ScreenAnchor Anchorpoint;


//hooks for mouse events, must be overwritten in subclass
//we only need left mouse button pressed yet, skipping the rest
simulated function OnLeftPressed(BG3PlayerController controller)
{
}

simulated function OnMouseOver()
{
}

simulated function OnMouseOut()
{
}

//make sure you call super.Draw from subclasses FIRST, important calc is happening here
simulated function Draw(Canvas drawonthis)
{
	//set canvas position relative to anchor
	if(drawonthis != none)
	{
		switch(Anchorpoint)
		{
			case TOPLEFT:
			ScreenPosX = OffsetX;
			ScreenPosY = OffsetY;
			break;

			case TOPRIGHT:
			ScreenPosX = drawonthis.ClipX - OffsetX-SizeX;
			ScreenPosY = OffsetY;
			break;

			case BOTTOMLEFT:
			ScreenPosX = OffsetX;
			ScreenPosY = drawonthis.ClipY - OffsetY - SizeY;
			break;

			case BOTTOMRIGHT:
			ScreenPosX = drawonthis.ClipX - OffsetX - SizeX;
			ScreenPosY = drawonthis.ClipY - OffsetY - SizeY;
			break;

			default:
			break;

		}
		drawonthis.SetPos(ScreenPosX,ScreenPosY);
		//set color
		drawonthis.SetDrawColor(Drawcolor.R,DrawColor.G,DrawColor.B,DrawColor.A);
	}
}

defaultproperties
{
	Anchorpoint = TOPLEFT
}